HTML5 Hacks by Jesse Cravens & Jeff Burtoft

HTML5 Hacks by Jesse Cravens & Jeff Burtoft

Author:Jesse Cravens & Jeff Burtoft [Cravens, Jesse and Burtoft, Jeff]
Language: eng
Format: epub
ISBN: 9781449334994
Publisher: O’Reilly Media, Inc.
Published: 2013-06-14T16:00:00+00:00


Figure 5-14. Our web page after the back button is clicked one time

If we continue to click the back button, the smile will be drawn, then the right eye, and then the left eye. After clicking the back button four times we will have a full smiley face (see Figure 5-15).

Figure 5-15. Our web page after the back button is clicked four times

If you have a keen eye, you may have noticed that we clicked the back button four times but we put five entries in the history stack. You may think you still have one additional back button click on this page before you would go back to the previous page. You would be wrong. The extra entry actually handles the initial page load. The event that is fired for the popstate happens on history change, not on back button clicks, so it actually fires when you load the page, as a page load adds to the history.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.